"""
英雄类
"""


class Hero:
    def __init__(self, name, my_hp, my_power):
        self.name = name
        self.my_hp = my_hp
        self.my_power = my_power

    # 打斗方法
    def fight(self, other_hero):
        hero_final_hp = self.my_hp - other_hero.power
        enemy_final_hp = other_hero.hp - self.my_power
        if hero_final_hp <= 0:
            print(f"{self.name}输掉比赛")



